From: David Härdeman Date: Wed, 15 Oct 2025 16:40:25 +0000 (+0200) Subject: luci-mod-network: organize "forward" tab in dhcp/dns views X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=15dfb9f0896c32ba6498cf79b303ab5c48252326;p=project%2Fluci.git luci-mod-network: organize "forward" tab in dhcp/dns views Delete the tab from dhcp.js, sort the options that belong to it in dns.js. Signed-off-by: David Härdeman --- diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js index c30be1f483..2c227592ce 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js @@ -391,7 +391,6 @@ return view.extend({ s.tab('general', _('General')); s.tab('devices', _('Devices & Ports')); - s.tab('forward', _('Forwards')); s.tab('limits', _('Limits')); s.tab('logging', _('Log')); s.tab('files', _('Resolv & Hosts Files')); @@ -470,13 +469,6 @@ return view.extend({ o.value('LOCAL7'); o.value('-', _('stderr')); - o = s.taboption('forward', form.DynamicList, 'server', - _('DNS Forwards'), - _('Forward specific domain queries to specific upstream servers.')); - o.optional = true; - o.placeholder = '/*.example.org/10.1.2.3'; - o.validate = validateServerSpec; - o = s.taboption('relay', form.SectionValue, '__relays__', form.TableSection, 'relay', null, _('Relay DHCP requests elsewhere. OK: v4↔v4, v6↔v6. Not OK: v4↔v6, v6↔v4.') + '
' + _('Note: you may also need a DHCP Proxy (currently unavailable) when specifying a non-standard Relay To port(addr#port).') @@ -593,43 +585,6 @@ return view.extend({ o.optional = true; o.depends('logdhcp', '0'); - o = s.taboption('forward', form.Value, 'serversfile', - _('Additional servers file'), - customi18n(_('File listing upstream resolvers, optionally domain-specific, e.g. {servers_file_entry01}, {servers_file_entry02}.') ) - ); - o.placeholder = '/etc/dnsmasq.servers'; - - o = s.taboption('forward', form.Value, 'addmac', - _('Add requestor MAC'), - _('Add the MAC address of the requestor to DNS queries which are forwarded upstream.') + ' ' + '
' + - _('%s uses the default MAC address format encoding').format('enabled') + ' ' + '
' + - _('%s uses an alternative encoding of the MAC as base64').format('base64') + ' ' + '
' + - _('%s uses a human-readable encoding of hex-and-colons').format('text')); - o.optional = true; - o.value('', _('off')); - o.value('1', _('enabled (default)')); - o.value('base64'); - o.value('text'); - - s.taboption('forward', form.Flag, 'stripmac', - _('Remove MAC address before forwarding query'), - _('Remove any MAC address information already in downstream queries before forwarding upstream.')); - - o = s.taboption('forward', form.Value, 'addsubnet', - _('Add subnet address to forwards'), - _('Add a subnet address to the DNS queries which are forwarded upstream, leaving this value empty disables the feature.') + ' ' + - _('If an address is specified in the flag, it will be used, otherwise, the address of the requestor will be used.') + ' ' + - _('The amount of the address forwarded depends on the prefix length parameter: 32 (128 for IPv6) forwards the whole address, zero forwards none of it but still marks the request so that no upstream nameserver will add client address information either.') + ' ' + '
' + - _('The default (%s) is zero for both IPv4 and IPv6.').format('0,0') + ' ' + '
' + - _('%s adds the /24 and /96 subnets of the requestor for IPv4 and IPv6 requestors, respectively.').format('24,96') + ' ' + '
' + - _('%s adds 1.2.3.0/24 for IPv4 requestors and ::/0 for IPv6 requestors.').format('1.2.3.4/24') + ' ' + '
' + - _('%s adds 1.2.3.0/24 for both IPv4 and IPv6 requestors.').format('1.2.3.4/24,1.2.3.4/24')); - o.optional = true; - - s.taboption('forward', form.Flag, 'stripsubnet', - _('Remove subnet address before forwarding query'), - _('Remove any subnet address already present in a downstream query before forwarding it upstream.')); - o = s.taboption('limits', form.Value, 'dhcpleasemax', _('Max. DHCP leases'), _('Maximum allowed number of active DHCP leases.')); diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dns.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dns.js index 95050a771a..079fa1e274 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dns.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dns.js @@ -872,6 +872,52 @@ return view.extend({ o.placeholder = '64.94.110.11'; // End filteropts + // Begin forward + o = s.taboption('forward', form.DynamicList, 'server', + _('DNS Forwards'), + _('Forward specific domain queries to specific upstream servers.')); + o.optional = true; + o.placeholder = '/*.example.org/10.1.2.3'; + o.validate = validateServerSpec; + + o = s.taboption('forward', form.Value, 'serversfile', + _('Additional servers file'), + customi18n(_('File listing upstream resolvers, optionally domain-specific, e.g. {servers_file_entry01}, {servers_file_entry02}.') ) + ); + o.placeholder = '/etc/dnsmasq.servers'; + + o = s.taboption('forward', form.Value, 'addmac', + _('Add requestor MAC'), + _('Add the MAC address of the requestor to DNS queries which are forwarded upstream.') + ' ' + '
' + + _('%s uses the default MAC address format encoding').format('enabled') + ' ' + '
' + + _('%s uses an alternative encoding of the MAC as base64').format('base64') + ' ' + '
' + + _('%s uses a human-readable encoding of hex-and-colons').format('text')); + o.optional = true; + o.value('', _('off')); + o.value('1', _('enabled (default)')); + o.value('base64'); + o.value('text'); + + s.taboption('forward', form.Flag, 'stripmac', + _('Remove MAC address before forwarding query'), + _('Remove any MAC address information already in downstream queries before forwarding upstream.')); + + o = s.taboption('forward', form.Value, 'addsubnet', + _('Add subnet address to forwards'), + _('Add a subnet address to the DNS queries which are forwarded upstream, leaving this value empty disables the feature.') + ' ' + + _('If an address is specified in the flag, it will be used, otherwise, the address of the requestor will be used.') + ' ' + + _('The amount of the address forwarded depends on the prefix length parameter: 32 (128 for IPv6) forwards the whole address, zero forwards none of it but still marks the request so that no upstream nameserver will add client address information either.') + ' ' + '
' + + _('The default (%s) is zero for both IPv4 and IPv6.').format('0,0') + ' ' + '
' + + _('%s adds the /24 and /96 subnets of the requestor for IPv4 and IPv6 requestors, respectively.').format('24,96') + ' ' + '
' + + _('%s adds 1.2.3.0/24 for IPv4 requestors and ::/0 for IPv6 requestors.').format('1.2.3.4/24') + ' ' + '
' + + _('%s adds 1.2.3.0/24 for both IPv4 and IPv6 requestors.').format('1.2.3.4/24,1.2.3.4/24')); + o.optional = true; + + s.taboption('forward', form.Flag, 'stripsubnet', + _('Remove subnet address before forwarding query'), + _('Remove any subnet address already present in a downstream query before forwarding it upstream.')); + // End forward + o = s.taboption('logging', form.Flag, 'logqueries', _('Log queries'), @@ -906,13 +952,6 @@ return view.extend({ o.value('LOCAL7'); o.value('-', _('stderr')); - o = s.taboption('forward', form.DynamicList, 'server', - _('DNS Forwards'), - _('Forward specific domain queries to specific upstream servers.')); - o.optional = true; - o.placeholder = '/*.example.org/10.1.2.3'; - o.validate = validateServerSpec; - o = s.taboption('relay', form.SectionValue, '__relays__', form.TableSection, 'relay', null, _('Relay DHCP requests elsewhere. OK: v4↔v4, v6↔v6. Not OK: v4↔v6, v6↔v4.') + '
' + _('Note: you may also need a DHCP Proxy (currently unavailable) when specifying a non-standard Relay To port(addr#port).') @@ -1029,43 +1068,6 @@ return view.extend({ o.optional = true; o.depends('logdhcp', '0'); - o = s.taboption('forward', form.Value, 'serversfile', - _('Additional servers file'), - customi18n(_('File listing upstream resolvers, optionally domain-specific, e.g. {servers_file_entry01}, {servers_file_entry02}.') ) - ); - o.placeholder = '/etc/dnsmasq.servers'; - - o = s.taboption('forward', form.Value, 'addmac', - _('Add requestor MAC'), - _('Add the MAC address of the requestor to DNS queries which are forwarded upstream.') + ' ' + '
' + - _('%s uses the default MAC address format encoding').format('enabled') + ' ' + '
' + - _('%s uses an alternative encoding of the MAC as base64').format('base64') + ' ' + '
' + - _('%s uses a human-readable encoding of hex-and-colons').format('text')); - o.optional = true; - o.value('', _('off')); - o.value('1', _('enabled (default)')); - o.value('base64'); - o.value('text'); - - s.taboption('forward', form.Flag, 'stripmac', - _('Remove MAC address before forwarding query'), - _('Remove any MAC address information already in downstream queries before forwarding upstream.')); - - o = s.taboption('forward', form.Value, 'addsubnet', - _('Add subnet address to forwards'), - _('Add a subnet address to the DNS queries which are forwarded upstream, leaving this value empty disables the feature.') + ' ' + - _('If an address is specified in the flag, it will be used, otherwise, the address of the requestor will be used.') + ' ' + - _('The amount of the address forwarded depends on the prefix length parameter: 32 (128 for IPv6) forwards the whole address, zero forwards none of it but still marks the request so that no upstream nameserver will add client address information either.') + ' ' + '
' + - _('The default (%s) is zero for both IPv4 and IPv6.').format('0,0') + ' ' + '
' + - _('%s adds the /24 and /96 subnets of the requestor for IPv4 and IPv6 requestors, respectively.').format('24,96') + ' ' + '
' + - _('%s adds 1.2.3.0/24 for IPv4 requestors and ::/0 for IPv6 requestors.').format('1.2.3.4/24') + ' ' + '
' + - _('%s adds 1.2.3.0/24 for both IPv4 and IPv6 requestors.').format('1.2.3.4/24,1.2.3.4/24')); - o.optional = true; - - s.taboption('forward', form.Flag, 'stripsubnet', - _('Remove subnet address before forwarding query'), - _('Remove any subnet address already present in a downstream query before forwarding it upstream.')); - o = s.taboption('limits', form.Value, 'dhcpleasemax', _('Max. DHCP leases'), _('Maximum allowed number of active DHCP leases.'));